<!DOCTYPE html>
<html>

<head>
    <title>网页换肤</title>
    <meta charset="utf-8">
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        ul {
            list-style: none;
            overflow: hidden;
        }

        .outer {
            width: 500px;
            margin: 0 auto;
            padding: 10px;
            background: yellow;
        }

        #skin li {
            width: 6px;
            height: 6px;
            float: left;
            margin-right: 10px;
            border-width: 4px;
            border-style: solid;
            cursor: pointer;
        }

        #red {
            border-color: red;
            background: red;
        }

        #green {
            border-color: green;
            background: green;
        }

        #black {
            border-color: black;
            background: black;
        }

        .current {
            background-color: #fff !important;
        }

        #nav li {
            width: 80px;
            height: 30px;
            line-height: 30px;
            float: left;
            margin: 10px 0.5px;
            background: red;
            text-align: center;
            font-size: 12px;
            color: #fff;
        }
    </style>

    <script>
        window.onload = function () {
            var skin = document.getElementById("skin");
            var col = skin.getElementsByTagName("li");
            var nav = document.getElementById("nav");
            var navCol = nav.getElementsByTagName("li");

            // var oLink = document.getElementsByTag("link")[0];
            for (var i = 0; i < col.length; i++) {
                col[i].onclick = function () {
                    for (var p in col) {
                        col[p].className = "";
                        this.className = "current";
                        //oLink['href'] = this.id + ".css";
                        //替换css文件，以达到切换的目的
                    }
                }
            }

        }
    </script>
</head>

<body>
    <div class="outer">
        <ul id="skin">
            <li id="red" title="红色" class="current"></li>
            <li id="green" title="绿色"></li>
            <li id="black" title="黑色"></li>
        </ul>
        <ul id="nav">
            <li>新闻</li>
            <li>娱乐</li>
            <li>体育</li>
            <li>电影</li>
            <li>音乐</li>
            <li>旅游</li>
        </ul>
    </div>
</body>

</html>